App.controller('mtBusController', ['$rootScope', '$scope', '$state', 'Page', function($rootScope, $scope, $state, Page) {


    $scope.grid = {
        maintenance : function(row) {
            Page.ajaxPost('maintenanceApply/adDataQuery.do', {busId : row.busId}, function(resp){
                $scope.mtApply = resp.data;
                $scope.maintenanceModal.show();
            })

        },
        column_defs: [
            {
                target : 11,
                buttons : [
                    {
                        name: '维修申请',
                        class: 'btn-warning btm-sm',
                        icon: 'glyphicon glyphicon-wrench',
                        event: 'maintenance'
                    }
                ]
            }
        ]
    };

    $scope.maintenanceModal = {
        onShow : function() {

        }
    };

    //客户集合
    $scope.queryCustomerList = function() {
        Page.ajaxPost('maintenanceApply/customerList.do', null, function(resp){
            $scope.customerList = resp.data;
        })
    }

    $scope.queryCustomerList();


}]);